<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../layui/jquery-3.2.1.min.js"></script>
    <script src="../layui/jquery.query.js"></script>
    <script src="../layui/layui.js"></script>
    <script src="js/grade.js"></script>
    <link href="../layui/css/layui.css" rel="stylesheet">
</head>
<body>
<div class="layui-container">
    <table class="layui-table">
        <thead>
        <tr>
            <th>角色名称</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody id="roleData"></tbody>
    </table>
    <div id="cutPageDiv"></div>

<div class="layui-row">
    <div class="layui-col-md4">
        <a href="javascript:add()" class="layui-btn">
            <i class="layui-icon layui-icon-add-circle"></i> 添加</a>
    </div>
</div>

</div>
<!--添加弹出层-->
<form class="layui-form" id="addDiv" style="display: none">
    <div class="layui-form-item">
        <label class="layui-form-label">角色姓名：</label>
        <div class="layui-input-block" style="display: flex;flex-direction: row">
            <input type="text" id="roleName" name="name" style="width: 150px;height: 30px" class="layui-input" placeholder="角色名称"><div id="roleNameError"></div>
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">拥有权限：</label>
        <span id="gradeSpan"></span><br>
    </div>
    <a class="layui-btn layui-btn-radius" href="javascript:addRole()">添加</a>
    <input type="reset" value="按钮" id="resetBtnAdd" style="display: none">
</form>

<!--修改弹出层-->
<form class="layui-form" id="updateDiv" style="display: none">
    <input type="hidden" name="id" id="id">

    角色名称： <span id="updateName"></span><br>

    拥有权限：<div class="layui-form-item">
    <div class="layui-input-block" id="updateGradeDiv">

    </div>
</div>

        <div><a class="layui-btn layui-btn-radius" href="javascript:updateGrade();">修改</a></div>
    <input type="reset" value="按钮" id="resetUpdateBtn" style="display: none">
</form>
</div>
</div>

<!--查看弹出层-->
<div style="display:none" id="findByIdDiv">

    角色名称： <span id="findByIdName"></span><br>
    拥有权限：<span id="findByIdGrade"></span><br>

</div>
</body>
</html>